Fixed Pin Code Feature

Now cross-platform, and stable ( after fixing I tested it a couple dozen times ).
Special Thanks to Yommy for providing me with his packet list, without it I would have never figured what was wrong with it.
Special Thanks to Jeroen who reported a inconsistency on the feature when used on windows.

Signed-off-by: shennetsind <ind@henn.et>