Your sketch will only call detachServos() if pos equals one. I see no way to guess what value it has when you're running your test, but if it wasn't one then that would explain your symptoms. It would be a lot easy to understand what was going on if your sketch printed status messages back to the serial port and you enhanced the Processing application to read and display them somewhere.