Enable error output for server return state mode_error

The server error flag mode_error probably indicates that the
value of the "type" parameter is disabled by the server.
Enable WIN32 (type=2) login mode

On Mar 1, 2013 the type=3 login mode was disabled by BNU's server.  To
overcome this, we implement the password and MAC address encoding
scheme used in the type=2 login mode and switch to that by default.
The legacy mode can be enabled by the "-e" switch at the command line.

In this mode, the server calculates the encoded password using its
current UNIX time.  Supposedly this timestamp is shared by the client
and the server yet unknown to a 3rd party.  The credentials are still
passed in plain HTTP packets.  Therefore it is now exactly as insecure
as it was before.

The server is unable to distinguish a wrong password from a right one
wrongly encoded due to time difference of the client and the server.
Therefore, syncing is needed, and this is done by reading the timestamp
appended to the "password_error" message.  If the message still appear
after syncing, we know the password is wrong.
Stub for heatbeater daemon
1. Close heartbeat socket after each beat.  2. Use pid lock files
Don't fail when failing to kill daemon.
Stops the daemon when server returns the "kicked" signal
Remove print statements used in debugging
Move import atexit to the "preamble"
Sync version tags
Replace pid file with permanent named pipe

To avoid possible pid collision (i.e. after the daemon crashes),
a new method based on named fifo pipe is used to control the daemons.
The program will mkfifo() a file at ~/.pysrun.fifo if none is found.
This fifo will be reused by future sessions.  In the future, the path
to this file could be made configurable.
Doc update