Bug 803791 - Guard against allocating a zero-capacity direct buffer. r=cpeterson a=bajaj