fix: handle TCP short reads/writes