Random Blume-Capel model on a cubic lattice: First-order inverse freezing in a three-dimensional spin-glass system