Some rigidity results for the Hawking mass and a lower bound for the Bartnik capacity