Snapping priority to vertex in QgsSnapper

Following the discussion in #1257, I modify QgsSnapper to give priority to vertex snapping above segment snapping. Instead of taking the closest snapping result, it tries first to take the closest vertex snapped. Only if no vertex has been snapped a segment can be chosen. This aims to solve http://hub.qgis.org/issues/7058 .