USB fixes from Petteri Aimonen, cherry-picked.

These fixes represent the most recent NuttX state (5669) and do fix known issues with CDC-ACM.