Ensure that _vim_{dec,enc} always succeeds on py3

In py2 we could get by with attempting to encode/decode a string and if
it failed just ignore and return.  Unfortunately on py3 a string decodes
to a bytearray and a bytearray encodes to a string.  We can't simply
return the original object when we fail.  We choose replace for handling
bytes we don't understand.

Test case (using python3 for UltiSnips):
open a new file
:set encoding=utf-8
qa<Backspace>q
"ap

Warning: this test case makes it very difficult to exit vim cleanly and
save files!

Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>