hm2: make encoder.rawcounts an Out pin, as claimed

This commit fixes bug #374: http://sourceforge.net/p/emc/bugs/374/

Before this commit, the hm2 encoder code would read the .rawcounts pin,
despite it being marked as an Out pin.  This would cause confusing
behavior when the pin changed value, for example when it was linked to
a signal.

This commit changes the hm2 encoder driver to keep an internal copy
of the rawcounts value, which can never be changed by outside forces.
All math is done on this stable internal copy, and the final value is
copied out to the .rawcounts pin when the dust settles.