amidi: Don't create extra write buffer

When sendWithTimestamp is called, a ~1000 byte buffer is created
even if nothing is sent. This CL adds a check to the size to save
space in the buffer if it's not needed.

Bug: 216328047
Test: atest NativeMidiEchoTest
Change-Id: I0bfddb6ca7416c5df5e938bdd09a5f1efdacaf5c
1 file changed