Add tests to cover codec autoswitch for stdin + tcp inputs

json->json_lines & plain->line

Tests for #1392
Closes #1394

Conflicts:
	spec/inputs/tcp.rb
inputs/base: Copy the codec's charset when switching.

Includes tests