Electrical properties and mechanical stability of anchoring groups for single-molecule electronics