Update bam_plcmd.c

1) Fixed the mixed output issue.
2) Improved speed